-----------------------------------
-- 	Guide Stone
-- 	Normal Text
-----------------------------------

-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
	
player:showText(npc,MATOAKA_SHOP_DIALOG);

stock = {4165,300, -- silent oil
	 4164,350, -- vis powder
         5314,10000, -- toolbag shihe
         4381,116, -- meat mith
         4413,77, -- apple pie
         4456,450, -- Boiled Crab
         15761,2000, -- chariot band
         0x3c56,50000, -- doesnt work
         0x3dcd,50000, -- doesnt work
         0x383a,50000, -- doesnt work
         0x3679,50000, -- doesnt work
         0x3c58,50000, -- doesnt work
         0x390f,50000, -- doesnt work
         0x3dcf,50000, -- doesnt work
         0x383c,50000, -- doesnt work
         0x3c55,50000, -- doesnt work
         0x39ef,50000, -- doesnt work
         0x3dcc,50000, -- doesnt work
	 0x3839,50000} -- doesnt work

 
showShop(player, STATIC, stock);
end; 

-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)

		if (trade:hasItemQty(1489,1)) and (trade:getGil() ==  1) then
			player:addItem(4272,1);
			player:tradeComplete(trade);
			player:messageSpecial(ITEM_OBTAINED,4272,1);
		end

	    if (trade:hasItemQty(1490,1)) and (trade:getGil() ==  1) then
			player:addItem(4272,8);
			player:tradeComplete(trade);
			player:messageSpecial(ITEM_OBTAINED,4272,8);
		end
	    if (trade:hasItemQty(1489,1)) and (trade:getGil() ==  2) and (player:getFreeSlotsCount() > 0) then
			player:addItem(1296,1);
			player:tradeComplete(trade);
			player:messageSpecial(ITEM_OBTAINED,1296,1);
		end	
	    if (trade:hasItemQty(1488,1)) and (trade:getGil() ==  3) then
			player:addItem(647,1);
			player:tradeComplete(trade);
			player:messageSpecial(ITEM_OBTAINED,647,1);
		end	
	    if (trade:hasItemQty(1489,1)) and (trade:getGil() ==  3) then
			player:addItem(1711,8);
			player:tradeComplete(trade);
			player:messageSpecial(ITEM_OBTAINED,1711,8);
		end		
			if (trade:hasItemQty(1488,1)) and (trade:getGil() ==  4) then
			player:addItem(2173,1);
			player:tradeComplete(trade);
			player:messageSpecial(ITEM_OBTAINED,2173,1);
		end		
	    if (trade:hasItemQty(1517,1))  then
			player:addItem(1466,1);
			player:tradeComplete(trade);
			player:messageSpecial(ITEM_OBTAINED,1466,1);
		end				
end; 
 
  
-----------------------------------
-- onEventFinish Action
-----------------------------------
function onEventFinish(player,csid,option)
--print("CSID:",csid);
--print("RESULT:",option);
end;